-
Notifications
You must be signed in to change notification settings - Fork 485
Feature/optimiser debugging improvements #2244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/optimiser debugging improvements #2244
Conversation
Signed-off-by: Kevin Wheatley <[email protected]>
Add sstream to LogUtils.cpp which was previously being included by transitive dependency in Op.h Signed-off-by: Kevin Wheatley <[email protected]>
…stage Store the result of IsDebugLoggingEnabled() to avoid taking the internal mutex and to ensure either none or all the debugging will be output for the duration optimisation call. Avoid calling operator<< between character string literals which can be combined by the preprocessor Replace use of std::endl with "\n" Signed-off-by: Kevin Wheatley <[email protected]>
Signed-off-by: Kevin Wheatley <[email protected]>
|
Sample output |
|
And the result from the shader |
|
From the sample log output you shared, my only comment would be that maybe we should add the current pass number ( |
doug-walker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Remi that it would be helpful to print the pass number.
| // Remove all ops for which isNoOp is true, including identity matrices. | ||
| int noops = optimizeIdentity ? RemoveNoOps(*this) : 0; | ||
| if (debugLoggingEnabled) | ||
| LogDebug(std::string("RemoveNoOps\n") + SerializeOpVec(*this, 4)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output is perhaps a bit difficult to read through since it's printing out the result at each step, even if there was no change. Each optimization function return 0 if no change was made, so for example, you could just print out the relevant items with (for this function):
if (noops > 0 && debugLoggingEnabled)
But I don't object to leaving it as is, if you find it more helpful.
This is a couple of changes related to improving the debug output of the optimiser.
Basically it outputs the results of each stage within the passes, that allows for better reasoning about what changes though the process, I've tried to ensure we don't suffer too much from the overhead from the extra logging during non-debug conditions.
I have not done any performance evaluation to confirm this so far.
As a side effect there is also a slight change to the includes to remove the dependency on pystring in the op/optimiser code.